import axios from 'poros/http';

export const postModelList = data =>
  axios({
    url: '/api/salesforecast-service/modelInfo/listByPage',
    method: 'post',
    data,
  });
export const postExportList = data =>
  axios({
    url: '/api/salesforecast-service/modelInfo/export',
    method: 'post',
    responseType: 'arraybuffer',
    hasInterceptors: true,
    data,
  });
export const postUpdateModel = data =>
  axios({
    url: '/api/salesforecast-service/modelInfo/update',
    method: 'post',
    data,
  });
export const postAddModel = data =>
  axios({
    url: '/api/salesforecast-service/modelInfo/insert',
    method: 'post',
    data,
  });
export const postDelModels = data =>
  axios({
    url: '/api/salesforecast-service/modelInfo/delete',
    method: 'post',
    data,
  });
export const postOrganizationInfo = data =>
  axios({
    url: '/api/salesforecast-service/organizationInfo/list',
    method: 'post',
    data,
  });

export const getDelModel = number =>
  axios({
    url: `/api/salesforecast-service/modelInfo/delete/${number}`,
    method: 'get',
  });
export const getModel = number =>
  axios({
    url: `/api/salesforecast-service/modelInfo/query/${number}`,
    method: 'get',
  });
export const getDictType = number =>
  axios({
    url: `/api/salesforecast-service/dictType/query/${number}`,
    method: 'get',
  });
